<?php
namespace app\admin\controller;
use think\Controller;

class Common extends Controller
{
    public $user_id;

    //初始化
    public function _initialize()
    {
        //定义系统的编码
        header("Content-Type:text/html; charset=utf-8");
        header('Content-Type:app/json; charset=utf-8');
        //验证是否登录
        $this->check_login();
    }



    //登录验证方法
    public function check_login(){

        $uid = session('admin.id');
        if(!$uid){
            $this->redirect('Index/login');
        }
    }
}
